package com.bh.vehicle.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bh.common.utils.DateUtils;
import com.bh.vehicle.domain.JcDriverupload;
import com.bh.vehicle.mapper.JcDriveruploadMapper;
import com.bh.vehicle.service.IJcDriveruploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * 司机驾照Service业务层处理
 *
 * @author slx
 * @date 2023-04-24
 */
@Service
public class JcDriveruploadServiceImpl extends ServiceImpl<JcDriveruploadMapper, JcDriverupload> implements IJcDriveruploadService {
    @Autowired
    private JcDriveruploadMapper jcDriveruploadMapper;

    /**
     * 查询司机驾照
     *
     * @param id 司机驾照主键
     * @return 司机驾照
     */
    @Override
    public JcDriverupload selectJcDriveruploadById(Long id) {
        return jcDriveruploadMapper.selectById(id);
    }

    /**
     * 查询司机驾照列表
     *
     * @param jcDriverupload 司机驾照
     * @return 司机驾照
     */
    @Override
    public List<JcDriverupload> selectJcDriveruploadList(JcDriverupload jcDriverupload) {
        return jcDriveruploadMapper.selectJcDriveruploadList(jcDriverupload);
    }

    /**
     * 新增司机驾照
     *
     * @param jcDriverupload 司机驾照
     * @return 结果
     */
    @Override
    public int insertJcDriverupload(JcDriverupload jcDriverupload) {
        jcDriverupload.setCreateTime(DateUtils.getNowDate());
        return jcDriveruploadMapper.insert(jcDriverupload);
    }

    /**
     * 修改司机驾照
     *
     * @param jcDriverupload 司机驾照
     * @return 结果
     */
    @Override
    public int updateJcDriverupload(JcDriverupload jcDriverupload) {
        return jcDriveruploadMapper.updateById(jcDriverupload);
    }

    /**
     * 批量删除司机驾照
     *
     * @param ids 需要删除的司机驾照主键
     * @return 结果
     */
    @Override
    public int deleteJcDriveruploadByIds(Long[] ids) {
        return jcDriveruploadMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除司机驾照信息
     *
     * @param id 司机驾照主键
     * @return 结果
     */
    @Override
    public int deleteJcDriveruploadById(Long id) {
        return jcDriveruploadMapper.deleteById(id);
    }
}
